//
//  LOLonlyTableViewCell.m
//  LOLXXbox
//
//  Created by mac on 16/3/1.
//  Copyright © 2016年 Grasstrio. All rights reserved.
//

#import "LOLonlyTableViewCell.h"
#define WIDTH [[UIScreen mainScreen]bounds].size.width
#define CONTENTWIDTH  self.contentView.frame.size.width

@implementation LOLonlyTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self =[super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        
        self.wordLabel=[[UILabel alloc]init];
        [self.contentView addSubview:self.wordLabel];

        
    }
    
    return self;
}

-(void)layoutSubviews
{
    
    [super layoutSubviews];
    NSDictionary *fontDic=[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],NSFontAttributeName, nil];
    
    CGRect rect=[self.wordLabel.text boundingRectWithSize:CGSizeMake(WIDTH-10, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDic context:nil];
    self.wordLabel.frame=CGRectMake(5, 5, CONTENTWIDTH-10, rect.size.height);
    
    self.wordLabel.font=[UIFont systemFontOfSize:14];
    self.wordLabel.numberOfLines=0;
    [self.wordLabel sizeToFit];
    
    
    
}



@end
